import { FetchRequest } from '../../lib';
import store from '../../configureStore';

const { Consts, createAPI, connectToRedux, resetResponseStatic } = FetchRequest;

setTimeout(() => {
  connectToRedux(store);
  resetResponseStatic({
    parseHeaders: (res) => {
      const responseCode = res.status;
      const responseMessage = res.message;
      // if (responseCode === 203 && res.content) {
      //   gotoSSo(res.content.location);
      // } else if (responseCode === 401) {
      //   gotoUnAuthorized();
      // }
      return { responseCode, responseMessage };
    },
    parseBody: res => res.content,
  });
});
export {
  Consts,
  createAPI,
};
